home *** CD-ROM | disk | FTP | other *** search
/ Aminet 25 / Aminet 25 (1998)(GTI - Schatztruhe)[!][Jun 1998].iso / Aminet / comm / cnet / cnet_pager.lha / doors / pager / PagerMaint < prev    next >
Encoding:
Text File  |  1998-03-15  |  7.6 KB  |  131 lines

  1. /**************************************************************************\
  2.          $VER: CNet Pager Maint, v5.20 (15-Mar-98) by Dotoran!
  3. \**************************************************************************/
  4. options results;signal on SYNTAX;signal on ERROR;signal on IOERR
  5. a=sourceline(2);parse var a . ", "ver" ("vdate")" .
  6. tr=transmit;se=sendstring;gc=getchar;gu=getuser;pu=putuser
  7. parse source . . fp .;df=left(fp,max(lastpos('/',fp),lastpos(':',fp)))
  8.  
  9. /* For CNet3/4 Compatibility. */
  10. /*            check;          HiPort;     check100;          online; */
  11. /*   3Port0  4Port0  3HiPort 4HiPort 3Ports  4Ports  3PrtLd  4PrtLd  */
  12. dat="2121864 2124654 2225094 2227884 2124264 2127054 2121862 2124652"
  13. bbsidentify bbs;a=word(result,3);cnet=(datatype(left(a,4),"n")=1&a>"4.44")+3
  14. guPORT0=word(dat,(cnet=4)+1) ; guHIPORT=word(dat,(cnet=4)+3)
  15. guPORTS=word(dat,(cnet=4)+5) ; guPORTL=word(dat,(cnet=4)+7)
  16.  
  17. bbsidentify sysop;sysop=result
  18. gu 1;handle=result;gu 40;id=result;save=1;call READCONFIG
  19. gen="He";if ge=2 then gen="She";gu 1302307;arg1=result
  20. if arg1="" | arg1="*" then arg1="0-"
  21. if upper(left(arg1,1))="C" then signal CONFIG
  22. if upper(left(arg1,1))="A" then signal SYSAVAIL
  23. if upper(left(arg1,1))="L" | upper(left(arg1,1))="V" then signal READLOG
  24. if upper(left(arg1,1))="D" then signal DELETELOG
  25. if datatype(left(arg1,1),"n")=0 then signal HELP
  26.  
  27. gu 1302368;arg2=result;if arg2="" then do;arg2="L";save=0
  28. tr "f1n1z4cf List Page Status for Port(s): z0n1";end
  29. if index("STF",upper(left(arg2,1)))>0 then do;arg2="S"
  30.   tr "f1n1z4cf Swap Page Status for Port(s): z0n1";end
  31. if index("YIA",upper(left(arg2,1)))>0 then do;arg2="Y"
  32.   tr "f1n1z4cf Enable Availability for Port(s): z0n1";end
  33. if index("NOU",upper(left(arg2,1)))>0 then do;arg2="N"
  34.   tr "f1n1z4cf Disable Availability for Port(s): z0n1";end
  35.  
  36. gu guPORTS;m=BitTST(d2c(result),4);se "cfGloballyc6: cd"sysop" c6is "
  37. tr word("c9UnAvailablec6! cbAvailablec6.",m+1)
  38.  
  39. gu guHIPORT;hp=result
  40.   tot=PARSE(arg1,hp);do i=1 to tot;p=it.i
  41.   gu guPORTL+p*24;lp=result
  42.   if lp<1 then lp=0;if lp=0 then do
  43.     tr "cfPort ce#ca"right(p,2)"c6: is c9NOT cbLoadedc6.";iterate;end
  44.   gu guPORT0+p*24;men=d2c(result)
  45.   if arg2="S" then men=BitCHG(men,4)
  46.   if arg2="Y" then men=BitSET(men,4)
  47.   if arg2="N" then men=BitCLR(men,4)
  48.   me=BitTST(men,4);if save=1 then do
  49.     setobject c2d(men);pu guPORT0+p*24 /* .--> check_latch; */
  50.     if cnet=4 then do;setobject "1";pu 2128304;end;end
  51.   se "cfPort ce#ca"right(p,2)"c6: cd"sysop" c6is ";if me=0 & m=1 then me=-1
  52.   tr word("c9UnAvailablec6! cbAvailablec6. c7[cbAvailablec7]",me+1+m)
  53.   end
  54. exit
  55.  
  56. CONFIG:;se "n1c6Loading cbPager cfConfigc6...#0"df"PagerConfig}";exit
  57. SYSAVAIL:;se "n1c6Loading cbPager cfSysAvailc6...#0"df"PagerSysAvail}";exit
  58. PARSE:;it.="";c=0;it=translate(Arg(1),"  ",".,");do a=1 to words(it);c=c+1;it.c=word(it,a);if index(it.c,"-")>0 then do;parse var it.c x"-"y
  59.   if upper(right(x,1))="A" then do;x=left(x,length(x)-1);if x=12 then x=0;end;if upper(right(x,1))="P" then x=left(x,length(x)-1)+12
  60.   if upper(right(y,1))="A" then do;y=left(y,length(y)-1);if y=12 then y=0;end;if upper(right(y,1))="P" then y=left(y,length(y)-1)+12
  61.   if y="" then y=Arg(2);if x="" then x=0;if x>y then do;d=x;x=y;y=d;end;do b=x to y;it.c=b;c=c+1;end b;c=c-1;end
  62.   else do;if upper(right(it.c,1))="A" then do;it.c=left(it.c,length(it.c)-1);if it.c=12 then it.c=0;end
  63.   if upper(right(it.c,1))="P" then it.c=left(it.c,length(it.c)-1)+12;end
  64.   if it.c=24 then it.c=0;if it.c>Arg(2) then do;c=c-1;iterate a;end;end a;return c
  65. HELP:;tr "f1@4ceCNet Amiga cbPager cfMaintc6, cf"ver" c6by cdDotoran c6of cdFrontiersc6!n1"
  66.   tr "cfFormatce: cd<caoptionalcd> cf[cerequiredcf] cd/ce=cf<c9orcf>n1"
  67.   tr ">4cbSYSCc9- caList Status for ALL Ports."
  68.   tr ">4cbSYS cd<cf[caPortc7(casc7)cf]cd>Cc9- ceList Specified  Port Status."
  69.   tr ">4cbSYS cd<cf[caPortc7(casc7)cf]cd> <cf[ceScf]cewapcd/cf[ceTcf]ceogglecd/cf[ceFcf]celipcd>   c9- caSwap    Availability Status."
  70.   tr ">4cbSYS cd<cf[caPortc7(casc7)cf]cd> <cf[ceYcf]ceescd/cf[ceIcf]cencd/cf[ceAcf]cevailablecd>   c9- ceEnable  Availability Status."
  71.   tr ">4cbSYS cd<cf[caPortc7(casc7)cf]cd> <cf[ceNcf]ceocd/cf[ceOcf]ceutcd/cf[ceUcf]cenavailablecd> c9- caDisable Availability Status.n1"
  72.   tr ">4cbSYS cd<cf[c9Acf]c9vailcd>Cc9- ceLoad Pager SysAvail Editor.n1"
  73.   tr ">4cbSYS cd<cf[ccCcf]cconfigcd>Cc9- caLoad Pager Config File."
  74.   tr ">4cbSYS cd<cf[ccLcf]ccogcd/cf[ccVcf]cciewcd>Cc9- ceDisplay Pager Log File."
  75.   tr ">4cbSYS cd<cf[ccDcf]ccelete Logcd>Cc9- caDelete Pager Log File."
  76.   tr ">4cbSYS cd<cf[ccHcf]ccelpcd/cf[cc?cf]cd/cf[cc/cf]cd>Cc9- ceShow This Help Menu Again.n1"
  77.   tr "c7<ccKeyc7>g1";exit
  78.  
  79. READLOG:;a=""
  80.   if handle=sysop then do
  81.     tr "n1cbSysOp cfChat ceLogsc6: (cb* c6= cbExistsc6)n1"
  82.     do i=1 to mtot ; ex=exists("sysdata:log/"logN||id.i)
  83.       tr "cf"right(i,7)"c6> cb"substr(" *",ex+1,1)" ca"sys.i
  84.     end i ; se "n1cbView ceWhichc6: cai64 2}" ; gu 70 ; b=result
  85.     if b<1 | b>mtot then b=1 ; a=id.b
  86.   end
  87.   else do ; a=id ; b=ctr ; end
  88.   if ~exists("sysdata:log/"logN||a) then do
  89.     tr "n1ce"sys.b"'s cfPager cbLog c6is c9emptyc6..." ; exit ; end
  90.   tr "n1caHandle of UserCcdDate Paged   cbReason for Paging "left(sys.b,17)"cePaged?"
  91.   tr "cc"copies("=",79)"*0sysdata:log/"logN||a"}cc"copies("=",79)
  92.   tr right("ceYcc=ceThey Paged Youcd, ceNcc=ceYou Weren't Availablecd, ceMcc=ceBut They Sent You Mailcd---'",78+12*3)
  93.   se "n1c9Delete cfPager cbLog c6now?"logkt" "logkill;gu 70;b=result
  94.   if b=0 then exit;else do;se "c9Deleting...";address command "delete sysdata:log/"logN||a;tr "h6edc6.";end
  95.  exit
  96. DELETELOG:;a=""
  97.   if handle=sysop then do ; tr "n1cbSysOp cfChat ceLogsc6: (cb* c6= cbExistsc6)n1"
  98.     do i=1 to mtot ; ex=exists("sysdata:log/"logN||id.i)
  99.       tr "cf"right(i,7)"c6> cb"substr(" *",ex+1,1)" ca"sys.i
  100.     end i ; se "n1c9Delete ceWhichc6: c9i64 2}";gu 70;b=result
  101.   if b<1|b>mtot then b=1;a=id.b;end;else do;a=id;b=ctr;end
  102.   if ~exists("sysdata:log/"logN||a) then do;tr "n1ce"sys.b"'s cfPager cbLog c6is c9emptyc6...";exit;end
  103.   se "n1c9Delete ce"sys.b"'s cfPager cbLog c6now? c7[caYesc7]c6: cb";gc;b=result;if b="N" then do;tr "cbNo.";exit;end;se "caYesc6! c9Deleting..."
  104.   address command "delete sysdata:log/"logN||a;tr "h6edc6.";exit
  105.  
  106. READCONFIG:
  107.   call open(f1,df"PagerConfigF","r")
  108.     a=readln(f1);parse var a gra"|"cc"|"cb"|"ac"|"hr"|"j
  109.     a=readln(f1);parse var a fpath"|"cost"|"kill"|"j
  110.     a=readln(f1);parse var a chsp"|"chvo"|"j
  111.     a=readln(f1);parse var a font"|"size"|"logN"|"logK"|"j
  112.     a=readln(f1);parse var a mtot"|"grp1"|"sys1"|"grp2"|"sys2"|",
  113.                              grp3"|"sys3"|"grp4"|"sys4"|"j
  114.     do i=1 to mtot;a=readln(f1)
  115.       parse var a id.i"|"sys.i"|"ge.i"|"mid.i"|"pos.i"|"snd.i"|"say.i"|"j
  116.       if id=id.i then ctr=i
  117.     end i
  118.   call close(f1)
  119.   logkill=""word("?1 ?0 =1 =0",logK+1);logkt=""
  120.   if logK=0 then logkt=" c7[caYesc7]c6:ca"
  121.   if logK=1 then logkt=" c7[caNoc7]c6:ca"
  122.  return
  123.  
  124. SYNTAX:;ERROR:;IOERR:;e1="n1 Error: "rc" ("errortext(rc)")"
  125.   e2="  Line: "left(sigl,4)"File:";c="`"fp", "ver"'";e2=e2" "c;tr e1;tr e2
  126.   logentry e1;logentry e2;e=strip(translate(sourceline(sigl),"\{",""))
  127.   do while e~="";e3="Source: "left(e,37);tr e3;logentry e3;e=substr(e,38);end
  128.   bufferflush
  129. /**************************************************************************\
  130. \****************************************** Frontiers BBS (716)/823-9892 **/
  131.